<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>发起聘请列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<form class="layui-form searchForm">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">姓名:</label>
            <div class="layui-input-inline">
                <input type="text" name="realName" id="realName" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">身份证号:</label>
            <div class="layui-input-inline">
                <input type="text" name="userCard" id="userCard" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <button class="layui-btn" lay-submit lay-filter="formDemo">查询</button>
                <button class="layui-btn" lay-submit>清空</button>
            </div>
        </div>
    </div>
</form>
<table class="layui-hide" id="dataList" lay-filter="dataList"></table>

<script type="text/html" id="toolbarOrg">
    <div class="layui-btn-container">
    </div>
</script>

<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看详情</a>
    {{# if(d.employStatus == 1){ }}
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="reason">拒绝原因</a>
    {{# } }}
</script>

<script type="text/javascript" src="/lib/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
<script>
    var configureCom = {};
    layui.use(['jquery', 'configureCom', 'configure', 'sessionFun', 'table', 'matchDict'], function () {
        var $ = layui.jquery;
        var configure = layui.configure;
        var table = layui.table;
        var sessionFun = layui.sessionFun;
        var matchDict = layui.matchDict;
        configureCom = layui.configureCom;
        var cols = [[
            {field: 'realName', title: '姓名'},
            {field: 'userCard', title: '身份证号'},
            {
                field: 'seal', title: '从事职务', templet: function (d) {
                    return '<p>' + matchDict.name(d.seal, configure.DUTY_TYPE_CODE) + '</p>'
                }
            },
            {field: 'launchDate', title: '发起日期'},
            {field: 'procesDate', title: '人员处理日期'},
            {
                field: 'employStatus', title: '请求结果', templet: function (d) {
                    return '<p>' + matchDict.name(d.employStatus, configure.EMPLOY_STATUS) + '</p>';
                }
            },
            {title: '操作', toolbar: '#barDemo', width: 200}
        ]];
        configureCom.tableRender(configure.COM_ZIZHI_USER_WAITJOB_LIST_HTTP, {}, cols, 'dataList', 10, '', 'toolbarOrg');
        configureCom.tableSearch();
        //每行操作
        table.on('tool(dataList)', function (obj) {
            var data = obj.data;
            sessionFun.set(configure.SESSION_ZIZHI_USER_LIST_DATA, data);
            if (obj.event === 'detail') {
                top.layer.open({
                    type: 2,
                    title: data.realName + '个人信息',
                    area: configureCom.Psize1,
                    content: configure.ORG_USER_ZIZHI_DETAIL_HTML
                });
            } else if (obj.event === 'reason') {
                top.layer.alert('拒绝原因:' + data.reasonRef);
            }
        });
    });
</script>
</body>
</html>